#include "PcsRunMode.h"

QString CPcsRunMode::GetName(int iPcsRunMode)
{
    QString ret = "unknown";
    if (LOCAL_MANUAL == iPcsRunMode) {
        //就地手动模式(屏上下发功率,操作一次才执行一次)
        ret = "local_manual";
    } else if (LOCAL_CURVE == iPcsRunMode) {
        //就地曲线(本地曲线,96个点,每个点表示15分钟,就地屏上设置点值)
        ret = "local_curve";
    } else if (LOCAL_CURRENT == iPcsRunMode) {
        //本地电流
        ret = "local_current";
    } else if (REMOTE_CURVE == iPcsRunMode) {
        //远程曲线(96个点,每个点表示15分钟,后台页面设置点值并下发到屏上)
        ret = "remote_curve";
    } else if (LOCAL_AUTO == iPcsRunMode) {
        //就地自动(小于某个下限值就充电,大于某个上限值就放电)
        ret = "local_auto";
    } else if (LOCAL_DEFINE == iPcsRunMode) {
        //就地自定义(自定义时间段)
        ret = "local_define";
    } else if (OTHER_REMOTE == iPcsRunMode) {
        //第三方远程(非云平台)
        ret = "other_remote";
    } else
    {
        //todo
    }

    return ret;
}
//是不是就地手动模式
bool CPcsRunMode::IsLocalManual(int iPcsRunMode)
{
    return LOCAL_MANUAL == iPcsRunMode;
}

//是不是就地曲线
bool CPcsRunMode::IsLocalCurve(int iPcsRunMode)
{
    return LOCAL_CURVE == iPcsRunMode;
}

//是不是就地电流
bool CPcsRunMode::IsLocalCurrent(int iPcsRunMode)
{
    return LOCAL_CURRENT == iPcsRunMode;
}

//是不是远程曲线
bool CPcsRunMode::IsRemoteCurve(int iPcsRunMode)
{
    return REMOTE_CURVE == iPcsRunMode;
}

//是不是就地自动
bool CPcsRunMode::IsLocalAuto(int iPcsRunMode)
{
    return LOCAL_AUTO == iPcsRunMode;
}

//是不是就地自定义
bool CPcsRunMode::IsLocalDefine(int iPcsRunMode)
{
    return LOCAL_DEFINE == iPcsRunMode;
}

//是不是第三方远程
bool CPcsRunMode::IsOtherRemote(int iPcsRunMode)
{
    return OTHER_REMOTE == iPcsRunMode;
}
